package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.SupplierServerImpl;
import com.ten.jinxiancun.utils.R;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
/*供货商资料表*/
@RestController
@RequestMapping("/Supp")
public class SupplierController {
    @Autowired
    SupplierServerImpl supp;
    @RequestMapping("/getAllSupp")
    public Object getAllSupp(@RequestParam Map<String,Object> map){
        Integer limit=Integer.parseInt(map.get("limit").toString());
        Integer page=Integer.parseInt(map.get("page").toString());
        map.put("limit",limit);
        map.put("page",(page-1)*limit);
        Result res=new Result("0","true",supp.countFind(map),supp.getAllSuppFind(map));
        return res;
    }
}
